package com.atguigu.gulimall.product.entity;

import com.atguigu.common.valid.AddGroup;
import com.atguigu.common.valid.ListVale;
import com.atguigu.common.valid.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * Ʒ
 *
 * @author zhengwu
 * @email jiachao@163.com
 * @date 2020-10-08 21:49:59
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * Ʒ
     */
    @TableId
    @Null(message = "新增时品牌ID为空", groups = AddGroup.class)
    @NotNull(message = "修改时必须指定品牌ID", groups = UpdateGroup.class)
    private Long brandId;
    /**
     * Ʒ
     */
    @NotBlank(message = "品牌名称不能为空!", groups = {AddGroup.class, UpdateGroup.class})
    private String name;
    /**
     * Ʒ
     */
    @NotBlank(groups = AddGroup.class)
    @URL(message = "logo地址不符合URL要求", groups = {AddGroup.class, UpdateGroup.class})
    private String logo;
    /**
     *
     */
    private String descript;
    /**
     *
     */

    @ListVale(vals = {0, 1}, groups = {AddGroup.class})
    private Integer showStatus;
    /**
     *
     */
    @NotEmpty
    @Pattern(regexp = "^[a-zA-Z]$", message = "请填写首字母a-z或A-Z") // 注意JS中正则写法是 “/^[a-zA-Z]$/”写的
    private String firstLetter;
    /**
     *
     */
    @NotNull
    @Min(value = 0, message = "排序的值要大于等于零 ")
    private Integer sort;


}
